<?php

class LanguageExperience extends AppModel {
    
    var $name = 'LanguageExperience';
    var $useTable = 'language_experiences';

    /*
     * belongsTo association with other application models
     */
    var $belongsTo = array(
            'Person' => array(
                'className' => 'Person'
            ),
            'Language' => array(
                'className' => 'Language'
            ),
            'ListeningLevel' => array(
                'className' => 'LanguageLevel',
                'foreignKey' => 'listening_level_id'
            ),
            'ReadingLevel' => array(
                'className' => 'LanguageLevel',
                'foreignKey' => 'reading_level_id'
            ),
            'SpokenInteractionLevel' => array(
                'className' => 'LanguageLevel',
                'foreignKey' => 'spoken_interaction_level_id'
            ),
            'SpokenProductionLevel' => array(
                'className' => 'LanguageLevel',
                'foreignKey' => 'spoken_production_level_id'
            ),
            'WritingLevel' => array(
                'className' => 'LanguageLevel',
                'foreignKey' => 'writing_level_id'
            ),
        );
    
    var $validate = array(
        'language_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Questo campo e\' obbligatorio'
        ),
        'listening_level_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Questo campo e\' obbligatorio'
        ),
        'reading_level_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Questo campo e\' obbligatorio'
        ),
        'spoken_interaction_level_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Questo campo e\' obbligatorio'
        ),
        'spoken_production_level_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Questo campo e\' obbligatorio'
        ),
        'writing_level_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Questo campo e\' obbligatorio'
        ),
        
    );
}

?>
